fix: Add backwards compatability with canvas provider#3773
fix: Add backwards compatability with canvas provider#3773mannycarrera4 wants to merge 19 commits intoWorkday:prerelease/majorfrom
Conversation
Workday/canvas-kit
|
||||||||||||||||||||||||||||||||||||||||
| Project |
Workday/canvas-kit
|
| Branch Review |
mc-forward-theming
|
| Run status |
|
| Run duration | 02m 24s |
| Commit |
|
| Committer | Manuel Carrera |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
15
|
|
|
0
|
|
|
790
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
19.37%
|
|
|---|---|
|
|
1530
|
|
|
365
|
Accessibility
99.38%
|
|
|---|---|
|
|
5 critical
5 serious
0 moderate
2 minor
|
|
|
67
|
…/canvas-kit into mc-forward-theming
There was a problem hiding this comment.
Pull request overview
This PR adds backwards compatibility to CanvasProvider for customizing theming via the theme prop. It addresses issue #3747 where the old theme format (e.g., brand.primary.base) doesn't work with the new semantic brand token system (e.g., brand.primary.600 and system.color.brand.*). The implementation creates mappings from deprecated theme palette keys to both legacy brand tokens and new numerical/system brand tokens.
Changes:
- Added comprehensive token mapping logic in
CanvasProviderto forward theme values from old palette format to new brand and system tokens - Updated popup theming to apply CSS variables earlier and remove cleanup to prevent theme flashing
- Updated documentation and examples to demonstrate scoped theming with the new backwards-compatible approach
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/react/common/lib/CanvasProvider.tsx | Core backwards compatibility logic with mappings from deprecated palette keys to numerical brand tokens and system tokens |
| modules/react/popup/lib/hooks/usePopupStack.ts | Refactored theme application timing and removed cleanup to prevent cascade barriers and theme flashing |
| modules/react/popup/stories/visual-testing/Popup.stories.tsx | Updated PopupThemed story to properly test themed popup with trigger button |
| modules/react/common/stories/mdx/examples/Theming.tsx | Updated example to demonstrate scoped theming with CanvasProvider theme prop |
| modules/react/common/stories/mdx/Theming.mdx | Extensive documentation updates explaining v14/v15 theming approach and backwards compatibility |
| modules/docs/mdx/15.0-UPGRADE-GUIDE.mdx | Added section explaining system brand tokens and backwards compatibility |
| modules/docs/llm/upgrade-guides/15.0-UPGRADE-GUIDE.md | Added section explaining system brand tokens and backwards compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Fixes: #3747
Release Category
Components
Release Note
We've added backwards compatibility to
CanvasProviderto customize theming via thethemeprop even though our components now use semantic brandable tokens. Consumers should only use this approach when creating ascopedtheme intended to break away from global theming.Checklist
ready for reviewhas been added to PRFor the Reviewer
Where Should the Reviewer Start?
Areas for Feedback? (optional)
Testing Manually
Screenshots or GIFs (if applicable)
Thank You Gif (optional)